Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend typedInput "num" type validity check to NaN, binary, octal & hex #4371

Merged
merged 1 commit into from Nov 1, 2023

Conversation

ralphwetzel
Copy link
Contributor

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Based on a forum exchange, this PR extends the validity checks for typedInput fields of type 'number'.

The following additional formats will pass the check:

  • NaN
  • Binary values, e.g.: 0b10101 or 0B11101
  • Octal values, e.g.: 0o1357 or 0O2468
  • Hex values, e.g.: 0x25aF or 0X69Cd

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@knolleary
Copy link
Member

Philosophically, NaN is the very definition of it not being a number... but I don't see a good reason to block it if you really need it.

@knolleary knolleary merged commit 01821ea into node-red:master Nov 1, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants